﻿package org.lanqiao.api.order;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id ="2016091700535296";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
	public static String merchant_private_key ="MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCJirSrQxhuJ9mHxuI7JNJKIcLw7oT+519CxskRQKx507lYOXnw+OxUJa1XU9w1yyza/aTqv5pYPbswNTf+AAJDHq9TRWSQCGWdOp3ku2x2MmwiNgjnekhn3Km31XxCrVU0ZtuxnILw8J1JfUc0BWYeQKOibrOHeBNqLOge3co+v4lmMIBnAowza2E5GdPdpFHTs0Vq8C/2Q8PDR7LmLZg2/twv0EK/3ghcKWUxGgJ5NuqCeigbkHKzf0p2oLYQod0wuTlRwAwu7thQlb1defaWO80/BCRjM9H56ihnw4Ekjs8FyLEW4b4iEBazq4vIC0vo+h7CLc5AnKWWX2W79FxhAgMBAAECggEBAIBl2Bs424mZ8dxqsa78xMMnmVBJmiZL4AX6hKFyepCQMipGHavy9MvpEFTBmIUvUoRs3JO4omFV33U1eTvIzlPSRWG7GhHLhPCuU8+/l5UPpRqazt0orocm29kdlo64OR5eFyFLNoGuXWbJaLsLfzUmqptsNHR2h8lKera13aOM1F124e7bqDPpnxje4QWK0ythD3e6XkKvP3T2E/bnq8SgZBomuJhiU4e8rtV+NhAHmVG4+rol/yzj72ks7eWoqqfPf7BVRbONSzgxgY9xJlIRgqqoGs3TZCsAADWg75Mifu4cUQ/HVR4rYQZJ0EiuHb+cl9gWqfw4wrcisxtBvQECgYEAvbkwd9cZpcx1Vft0hNsR02++5aMQbPc0EdibrpmIG+WRenJW7sXb5c3JvGuTzYcVcxundma2TGw1Pm2kNVD4C5f3aHQPqz4rBq5Lgd1W+kuNP2uCm50n4zRisVsHnu6mub5clE2ThCVCtJpNfBsUYjS9/i3bsLn0FZZ9QEh2d0kCgYEAuZb1wldQSpyDckh7vdPGXDhRqDNaxiN5zT+GTafeB8pWmVkjOAdaRmYz6dZ935eKWsqvoJIm/F9YQYG6raC4w5XehdUdiDhOID5lxmaq50GG8zRasnmynPLezfo79DP9ZeamNjXQJ+vlNDs7dD2mbcoEbVn2npfv0Yb7hxbpxFkCgYEAh4xTA5wLt/g+8MJp+i2mK8EPy3NYXfG0Ivf2KqWIqB25dZlRYOC9/g6sDlFx1QqpGYdtetthbXJ2C/c7tdf2kBnv6pHZTAhrpydJzSu9Y7As513Bf7qlb9/Sj1IxPKzXM6e87zwJpAUXBn+j0oJqasux3nMXHcmNiQruy8m50fkCgYEAqaHf09h23Rud0dGKuQFep2Aa0wDNkZlPdVkA6u3qtXguG1AsLsQZsYstHCkfOEWNAluMl9m+pKKJSqbG+HiVKMBNekpHCgFc93/RCr1ArMtqC9XoqIUvyuD64Y49SoJStNdTSO1662JkR490UlUfT+58iW7XSjJZ00vrj5hT51ECgYBb0UWlTMQbmKER1tQ6UjEB/0lmCpTbV2F/nY2+5kJmz7PKYqEC9qaZyF0sUaFkQ74lyBdxtmBSlTq28sK4RMCvID8dsaQzgJgnR69dBWnu7pOV2YEHaEiYB0h+SGLWRXY1u83xWu8XX7qK0ZKNU1VX9SsNs4lljv2OpM1vjyLSAQ==";
//	60.205.201.24
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAysNNj6qGPE38BFmyv07kUIGkmttA3xXgio6b22a2Qyg4lcTkVsk+arJzy++whTCXKsYrojTVO6/YF17gLx0Tbe8dRgOhVhCTn9xLAvV5BCw9+ApoSufEV+3UEmctcbO9yCnEWmUOrJJK0Wms0qsed2iTujePSHYCBEBJ6P8+cnKMUWO+UZU2q+zOjdEY5qFV45DsUZfvq+CZD2mizjc/S9XH6eH8J8roKHD+Q9Y+nYKwQPX0WY9E+5N4rgrfkFOEbiI02Slc1Sy8aLSKJu5lYG1CtHreq72VGTTgo2TU697blpdXfc50HgdE2ywJT1H2FLvLP78eADdPI+SHYjlObQIDAQAB";
	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://60.205.201.24/Taru-Xmall/NotifyurlServlet";
//	public static String return_url = "http://localhost:8080/Taru-Xmall/ReturnServlet";
	public static String return_url = "http://127.0.0.1:8020/xmall1/self_info.html?__hbt=1535198695730";
	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

